home *** CD-ROM | disk | FTP | other *** search
- 180
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- WaitForWindow
- --- RECORDSEPARATOR ---
- Platform:
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Windows and Macintosh
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Description:
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- baWaitForWindow waits until a window is in a specified state, with an optional
- --- RECORDSEPARATOR ---
- timeout.
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Usage:
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Result = baWaitForWindow( WinHandle, State, TimeOut )
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Arguments:
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Integer, String, Integer
- --- RECORDSEPARATOR ---
- WinHandle is the handle of the window to wait for.
- --- RECORDSEPARATOR ---
- State is the state to wait for. Can be:
- --- RECORDSEPARATOR ---
- "inactive"
- --- RECORDSEPARATOR ---
- waits until the window is inactive
- --- RECORDSEPARATOR ---
- "active"
- --- RECORDSEPARATOR ---
- waits until the window is active
- --- RECORDSEPARATOR ---
- "closed"
- --- RECORDSEPARATOR ---
- waits until the window is closed
- --- RECORDSEPARATOR ---
- TimeOut is the maximum amount of time to wait in ticks. A tick is equal to 1/60th of
- --- RECORDSEPARATOR ---
- a second. If TimeOut is 0, the function will wait indefinitely.
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Returns:
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Integer.
- --- RECORDSEPARATOR ---
- Returns 0 if the window doesn't exist, or the timeout occurs before the window
- --- RECORDSEPARATOR ---
- reaches the specified state.
- --- RECORDSEPARATOR ---
- Returns 1 if the window reached the specified state.
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Examples:
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Director:
- --- RECORDSEPARATOR ---
- set OK = baWaitForWindow( baWinHandle(), "active", 300 ) --
- --- RECORDSEPARATOR ---
- waits for the Director
- --- RECORDSEPARATOR ---
- window to become active, for a maximum of 5 seconds
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Authorware:
- --- RECORDSEPARATOR ---
- OK := baWaitForWindow( 3248, "closed", 600 )
- --- RECORDSEPARATOR ---
- -- waits for the window 3248 to be
- --- RECORDSEPARATOR ---
- closed, for a maximum of 10 seconds
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Notes:
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- The "inactive" option is useful for waiting until the Director/Authorware window is
- --- RECORDSEPARATOR ---
- inactive after starting another program. When the Director/Authorware window is
- --- RECORDSEPARATOR ---
- no longer active, then the other program has opened and has focus.
- --- RECORDSEPARATOR ---
- For example, here is some code to open a readme file in Authorware, and wait until
- --- RECORDSEPARATOR ---
- the user has finished with it.
- --- RECORDSEPARATOR ---
- if baOpenFile( "readme.txt" , "normal" ) > 32 then
- --- RECORDSEPARATOR ---
- --
- --- RECORDSEPARATOR ---
- open readme file
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- wnd := baNextActiveWindow( 0 )
- --- RECORDSEPARATOR ---
- --
- --- RECORDSEPARATOR ---
- get handle of Notepad window
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- baWaitForWindow( baWinHandle() , "active" , 0 )
- --- RECORDSEPARATOR ---
- --
- --- RECORDSEPARATOR ---
- wait till the Authorware
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- --
- --- RECORDSEPARATOR ---
- window is active i.e. Notepad has been close
- --- RECORDSEPARATOR ---
- -- or user switched back to Authorware
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- if baWindowExists( wnd )
- --- RECORDSEPARATOR ---
- then baCloseWindow( wnd )
- --- RECORDSEPARATOR ---
- --
- --- RECORDSEPARATOR ---
- close Notepad
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- end if
- --- RECORDSEPARATOR ---
- end if
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- See also:
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- baWaitTillActive
- --- RECORDSEPARATOR ---
- baNextActiveWindow
- --- RECORDSEPARATOR ---
- baActiveWindow